package demo3;

public interface IUSB {
    void openDevice();
    void closeDevice();

    default void test(){
        System.out.println("默认test方法");
    }
}

// 抽象类也可以实现接口的
abstract class A implements IUSB{
    public abstract void test1();
}

class B extends A{
    @Override
    public void test() {
        System.out.println("hehe");
    }

    @Override
    public void test1() {
        System.out.println("haha");
    }

    @Override
    public void openDevice() {
        System.out.println("打开设备...");
    }

    @Override
    public void closeDevice() {
        System.out.println("关闭设备...");
    }
}



